<%--
  Created by IntelliJ IDEA.
  User: Tian
  Date: 2024/3/6
  Time: 17:06
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
<html>
<head>
    <title>Title</title>
    <script src="js/jquery-3.6.3.min.js"></script>
    <style>
        img{
            width: 80px;
            height: 80px;;
            border-radius: 50%;
        }

        a{
            text-decoration: none;
        }
        table{
            width: 500px;
            height: 400px;
            margin: auto;
            border-collapse: collapse;

        }
        table,th,td{
            border: 1px solid black;
        }

        t

    </style>
</head>
<body>
  <table id="table">
      <tr><td colspan="7"><a href="addUser.jsp">添加</a></td></tr>
      <tr>
          <th>编号</th>
          <th>账号</th>
          <th>密码</th>
          <th>头像</th>
          <th>昵称</th>
          <th>性别</th>
          <th>操作</th>
      </tr>
      <c:forEach items="${requestScope.pageInfo.list}" var="u">
          <tr>
              <td>${u.id}</td>
              <td>${u.name}</td>
              <td>${u.password}</td>
              <td><img src="${u.head}"/></td>
              <td>${u.nick}</td>
              <td>${u.sex}</td>
              <td><a href="get?id=${u.id}">修改</a>&nbsp;<a href="delete?id=${u.id}">删除</a></td>
          </tr>
      </c:forEach>
      <tr>
          <td colspan="7">
              <c:if test="${requestScope.pageInfo.pageNum==1}">
                  <a>上一页</a>
              </c:if>
              <c:if test="${requestScope.pageInfo.pageNum!=1}">
                  <a href="gets?current=${requestScope.pageInfo.pageNum-1}">上一页</a>
              </c:if>
              <c:forEach begin="1" step="1" end="${requestScope.pageInfo.pages}" var="i">
                  <a href="gets?current=${i}">${i}</a>
              </c:forEach>
              <c:if test="${requestScope.pageInfo.pageNum==requestScope.pageInfo.pages}">
                  <a>下一页</a>
              </c:if>
              <c:if test="${requestScope.pageInfo.pageNum!=requestScope.pageInfo.pages}">
                  <a href="gets?current=${requestScope.pageInfo.pageNum+1}">下一页</a>
              </c:if>
          </td>
      </tr>
  </table>


</body>
</html>
